<?php

namespace app\controllers;

use app\controllers\action\Teacher;
use core\controller\Controller;
use db\Conn;

class delete_student implements Controller
{
    public static function execute()
    {
        $return = ["code" => 400, "data" => [], "msg" => "删除学生失败"];
        $conn = Conn::execute();
        if ($_SESSION["user_type"] == "teacher") {
            if (Teacher::delete_student($conn, $_POST["student_id"])) {
                $return["code"] = 200;
                $return["msg"] = "删除学生成功";
            }
        }

        $conn->close();

        return $return;
    }
}